package com.gardenguell.salad.ui.activity;

import android.os.Bundle;
import android.os.PersistableBundle;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.ImageView;
import com.gardenguell.salad.R;
import com.gardenguell.salad.ui.activity.base.BaseActivity;
import com.gardenguell.salad.ui.activity.base.ToolbarActivity;
import com.gardenguell.salad.ui.view.KeyboardControlEditText;
import com.gardenguell.salad.util.ImageLoaderHelper;

public class AddHistoryActivity extends ToolbarActivity {

    private KeyboardControlEditText mHistoryContent;
    private ImageView mHistoryPhoto;

    private String mImagePath;

    @Override
    protected int provideContentViewId() {
        return R.layout.activity_add_history;
    }

    @Override
    public boolean canBack() {
        return true;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mImagePath = getIntent().getStringExtra("imagePath");

        mHistoryContent = (KeyboardControlEditText)findViewById(R.id.history_content);
        mHistoryPhoto = (ImageView)findViewById(R.id.history_photo);

        ImageLoaderHelper.getInstance().show(mHistoryPhoto, "file://" + mImagePath);

    }


    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.menu_add_history, menu);
        return true;
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        switch(item.getItemId()){
            case R.id.action_send_content:
                finish();
                break;
            default:
                break;
        }
        return true;
    }
}
